<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Chapter 2 Package prerequisite and installation | Extract, Analyze and Visualize Mutational Signatures with Sigminer</title>
<meta name="author" content="Shixiang Wang, PhD (Sun Yat-sen University Cancer Center)">
<meta name="author" content="Xue-Song Liu, PhD (ShanghaiTech University)">
<meta name="description" content="2.1 Package prerequisite All R package dependencies of sigminer can be checked at specific fields of DESCRIPTION file. Of note, unlike common R package, many key features of sigminer are only...">
<meta name="generator" content="bookdown 0.28 with bs4_book()">
<meta property="og:title" content="Chapter 2 Package prerequisite and installation | Extract, Analyze and Visualize Mutational Signatures with Sigminer">
<meta property="og:type" content="book">
<meta property="og:description" content="2.1 Package prerequisite All R package dependencies of sigminer can be checked at specific fields of DESCRIPTION file. Of note, unlike common R package, many key features of sigminer are only...">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Chapter 2 Package prerequisite and installation | Extract, Analyze and Visualize Mutational Signatures with Sigminer">
<meta name="twitter:description" content="2.1 Package prerequisite All R package dependencies of sigminer can be checked at specific fields of DESCRIPTION file. Of note, unlike common R package, many key features of sigminer are only...">
<!-- JS --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://kit.fontawesome.com/6ecbd6c532.js" crossorigin="anonymous"></script><script src="libs/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="libs/bootstrap-4.6.0/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-4.6.0/bootstrap.bundle.min.js"></script><script src="libs/bs3compat-0.4.0/transition.js"></script><script src="libs/bs3compat-0.4.0/tabs.js"></script><script src="libs/bs3compat-0.4.0/bs3compat.js"></script><link href="libs/bs4_book-1.0.0/bs4_book.css" rel="stylesheet">
<script src="libs/bs4_book-1.0.0/bs4_book.js"></script><script src="libs/htmlwidgets-1.5.4/htmlwidgets.js"></script><link href="libs/datatables-css-0.0.0/datatables-crosstalk.css" rel="stylesheet">
<script src="libs/datatables-binding-0.24/datatables.js"></script><link href="libs/dt-core-1.11.3/css/jquery.dataTables.min.css" rel="stylesheet">
<link href="libs/dt-core-1.11.3/css/jquery.dataTables.extra.css" rel="stylesheet">
<script src="libs/dt-core-1.11.3/js/jquery.dataTables.min.js"></script><link href="libs/crosstalk-1.2.0/css/crosstalk.min.css" rel="stylesheet">
<script src="libs/crosstalk-1.2.0/js/crosstalk.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- CSS --><style type="text/css">
    
    div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
  </style>
<style type="text/css">
    /* Used with Pandoc 2.11+ new --citeproc when CSL is used */
    div.csl-bib-body { }
    div.csl-entry {
      clear: both;
        }
    .hanging div.csl-entry {
      margin-left:2em;
      text-indent:-2em;
    }
    div.csl-left-margin {
      min-width:2em;
      float:left;
    }
    div.csl-right-inline {
      margin-left:2em;
      padding-left:1em;
    }
    div.csl-indent {
      margin-left: 2em;
    }
  </style>
</head>
<body data-spy="scroll" data-target="#toc">

<div class="container-fluid">
<div class="row">
  <header class="col-sm-12 col-lg-3 sidebar sidebar-book"><a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>

    <div class="d-flex align-items-start justify-content-between">
      <h1>
        <a href="index.html" title="">Extract, Analyze and Visualize Mutational Signatures with Sigminer</a>
      </h1>
      <button class="btn btn-outline-primary d-lg-none ml-2 mt-1" type="button" data-toggle="collapse" data-target="#main-nav" aria-expanded="true" aria-controls="main-nav"><i class="fas fa-bars"></i><span class="sr-only">Show table of contents</span></button>
    </div>

    <div id="main-nav" class="collapse-lg">
      <form role="search">
        <input id="search" class="form-control" type="search" placeholder="Search" aria-label="Search">
</form>

      <nav aria-label="Table of contents"><h2>Table of contents</h2>
        <ul class="book-toc list-unstyled">
<li><a class="" href="index.html">📖 Introduction</a></li>
<li class="book-part">Part I: Background and Prerequisite</li>
<li><a class="" href="mutsig-intro.html"><span class="header-section-number">1</span> Mutational signatures</a></li>
<li><a class="active" href="prerequisite.html"><span class="header-section-number">2</span> Package prerequisite and installation</a></li>
<li class="book-part">Part II: Workflows</li>
<li><a class="" href="basic-workflow.html"><span class="header-section-number">3</span> Mutational signature analysis basics</a></li>
<li><a class="" href="analysis-supps.html"><span class="header-section-number">4</span> Other signature types</a></li>
<li><a class="" href="target-vis.html"><span class="header-section-number">5</span> Target visualization</a></li>
<li class="book-part">Part III: Miscellaneous topics</li>
<li><a class="" href="universal-analysis.html"><span class="header-section-number">6</span> Universal analysis</a></li>
<li><a class="" href="subtype-prediction.html"><span class="header-section-number">7</span> Subtype prediction</a></li>
<li><a class="" href="sigflow.html"><span class="header-section-number">8</span> Sigflow pipeline</a></li>
<li><a class="" href="datasets.html"><span class="header-section-number">9</span> Datasets</a></li>
<li><a class="" href="convert.html"><span class="header-section-number">10</span> SBS signature conversion</a></li>
<li class="book-part">Appendix</li>
<li><a class="" href="references.html">References</a></li>
</ul>

        <div class="book-extra">
          
        </div>
      </nav>
</div>
  </header><main class="col-sm-12 col-md-9 col-lg-7" id="content"><div id="prerequisite" class="section level1" number="2">
<h1>
<span class="header-section-number">2</span> Package prerequisite and installation<a class="anchor" aria-label="anchor" href="#prerequisite"><i class="fas fa-link"></i></a>
</h1>
<div id="package-prerequisite" class="section level2" number="2.1">
<h2>
<span class="header-section-number">2.1</span> Package prerequisite<a class="anchor" aria-label="anchor" href="#package-prerequisite"><i class="fas fa-link"></i></a>
</h2>
<p>All R package dependencies of <strong>sigminer</strong> can be checked at <a href="https://github.com/ShixiangWang/sigminer/blob/4a10d0811cb3bcb02dbbff73ed1c218954bf9b42/DESCRIPTION#L45-L100">specific fields of <em>DESCRIPTION</em> file</a>.
Of note, unlike common R package, many key features of <strong>sigminer</strong> are only available when the suggested packages are installed.
Most of them are from <a href="http://bioconductor.org/"><em>Bioconductor</em></a>, so R package <strong>BiocManager</strong> must be installed
before installing <strong>sigminer</strong>. You have to use <strong>BiocManager</strong> instead of <code><a href="https://rdrr.io/r/utils/install.packages.html">install.packages()</a></code> to install <strong>sigminer</strong>.
If you want to handle other reference genome data except <code>hg19</code>, e.g., for <code>hg38</code>, you also have to install <em>Bioconductor</em>
package <strong>BSgenome.Hsapiens.UCSC.hg38</strong> before/after installing <strong>sigminer</strong>.</p>
</div>
<div id="package-installation" class="section level2" number="2.2">
<h2>
<span class="header-section-number">2.2</span> Package installation<a class="anchor" aria-label="anchor" href="#package-installation"><i class="fas fa-link"></i></a>
</h2>
<p>The stable release version of <strong>sigminer</strong> package can be installed from the CRAN:</p>
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a></span><span class="op">(</span><span class="st">"BiocManager"</span><span class="op">)</span></span>
<span><span class="fu">BiocManager</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/BiocManager/man/install.html">install</a></span><span class="op">(</span><span class="st">"sigminer"</span>, dependencies <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div>
<p>Set <code>dependencies = TRUE</code> is recommended because many packages are required for accessing full features provided by <strong>sigminer</strong> (we described this in previous section).
The development version of <strong>sigminer</strong> package can be installed from Github or Gitee after installing CRAN version <strong>sigminer</strong>:</p>
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a></span><span class="op">(</span><span class="st">"remotes"</span><span class="op">)</span></span>
<span><span class="co"># From GitHub</span></span>
<span><span class="fu">remotes</span><span class="fu">::</span><span class="fu"><a href="https://remotes.r-lib.org/reference/install_github.html">install_github</a></span><span class="op">(</span><span class="st">"ShixiangWang/sigminer"</span>, dependencies <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
<span><span class="co"># From Gitee</span></span>
<span><span class="fu">remotes</span><span class="fu">::</span><span class="fu"><a href="https://remotes.r-lib.org/reference/install_git.html">install_git</a></span><span class="op">(</span><span class="st">"https://gitee.com/ShixiangWang/sigminer"</span>, dependencies <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div>
<p>If you see notification of package update, please keep this package up to date.</p>
<p>The <strong>sigminer</strong> is also available in Conda <em>forge</em> channel. If you are using Conda,
you can install <strong>sigminer</strong> with:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="prerequisite.html#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Please note version number of the bioconda release</span></span>
<span id="cb3-2"><a href="prerequisite.html#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-3"><a href="prerequisite.html#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="co"># You can install an individual environment firstly with</span></span>
<span id="cb3-4"><a href="prerequisite.html#cb3-4" aria-hidden="true" tabindex="-1"></a><span class="co"># conda create -n sigminer</span></span>
<span id="cb3-5"><a href="prerequisite.html#cb3-5" aria-hidden="true" tabindex="-1"></a><span class="co"># conda activate sigminer</span></span>
<span id="cb3-6"><a href="prerequisite.html#cb3-6" aria-hidden="true" tabindex="-1"></a>conda install <span class="sc">-</span>c bioconda <span class="sc">-</span>c conda<span class="sc">-</span>forge r<span class="sc">-</span>sigminer</span></code></pre></div>
</div>
<div id="package-loading" class="section level2" number="2.3">
<h2>
<span class="header-section-number">2.3</span> Package loading<a class="anchor" aria-label="anchor" href="#package-loading"><i class="fas fa-link"></i></a>
</h2>
<p>To load package, run:</p>
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://github.com/ShixiangWang/sigminer">sigminer</a></span><span class="op">)</span></span></code></pre></div>
<p>More info about <strong>sigminer</strong> can be given as:</p>
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/pkg/sigminer/man/hello.html">hello</a></span><span class="op">(</span><span class="op">)</span></span>
<span><span class="co">## Thanks for using 'sigminer' package!</span></span>
<span><span class="co">## =========================================================================</span></span>
<span><span class="co">## Version: 2.1.1</span></span>
<span><span class="co">## Run citation('sigminer') to see how to cite sigminer in publications.</span></span>
<span><span class="co">## </span></span>
<span><span class="co">## Project home : https://github.com/ShixiangWang/sigminer</span></span>
<span><span class="co">## Bug report   : https://github.com/ShixiangWang/sigminer/issues</span></span>
<span><span class="co">## Documentation: https://shixiangwang.github.io/sigminer-book/</span></span>
<span><span class="co">## =========================================================================</span></span>
<span><span class="co">## </span></span></code></pre></div>
</div>
<div id="package-references" class="section level2" number="2.4">
<h2>
<span class="header-section-number">2.4</span> Package references<a class="anchor" aria-label="anchor" href="#package-references"><i class="fas fa-link"></i></a>
</h2>
<p>All datasets/functions are well organized and documented at <a href="https://shixiangwang.github.io/sigminer/reference/index.html">package <em>referrence</em> list</a>.
For checking usage of a specific function <code>fun</code>, you can also run <code>?fun</code> in your R console.
For example, to see usage <code><a href="https://rdrr.io/pkg/sigminer/man/read_copynumber.html">read_copynumber()</a></code></p>
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://github.com/ShixiangWang/sigminer">sigminer</a></span><span class="op">)</span></span>
<span><span class="op">?</span><span class="va">read_copynumber</span></span></code></pre></div>

</div>
</div>



  <div class="chapter-nav">
<div class="prev"><a href="mutsig-intro.html"><span class="header-section-number">1</span> Mutational signatures</a></div>
<div class="next"><a href="basic-workflow.html"><span class="header-section-number">3</span> Mutational signature analysis basics</a></div>
</div></main><div class="col-md-3 col-lg-2 d-none d-md-block sidebar sidebar-chapter">
    <nav id="toc" data-toggle="toc" aria-label="On this page"><h2>On this page</h2>
      <ul class="nav navbar-nav">
<li><a class="nav-link" href="#prerequisite"><span class="header-section-number">2</span> Package prerequisite and installation</a></li>
<li><a class="nav-link" href="#package-prerequisite"><span class="header-section-number">2.1</span> Package prerequisite</a></li>
<li><a class="nav-link" href="#package-installation"><span class="header-section-number">2.2</span> Package installation</a></li>
<li><a class="nav-link" href="#package-loading"><span class="header-section-number">2.3</span> Package loading</a></li>
<li><a class="nav-link" href="#package-references"><span class="header-section-number">2.4</span> Package references</a></li>
</ul>

      <div class="book-extra">
        <ul class="list-unstyled">
          
        </ul>
</div>
    </nav>
</div>

</div>
</div> <!-- .container -->

<footer class="bg-primary text-light mt-5"><div class="container"><div class="row">

  <div class="col-12 col-md-6 mt-3">
    <p>"<strong>Extract, Analyze and Visualize Mutational Signatures with Sigminer</strong>" was written by Shixiang Wang, PhD (Sun Yat-sen University Cancer Center), Xue-Song Liu, PhD (ShanghaiTech University). It was last built on 2022-08-29.</p>
  </div>

  <div class="col-12 col-md-6 mt-3">
    <p>This book was built by the <a class="text-light" href="https://bookdown.org">bookdown</a> R package.</p>
  </div>

</div></div>
</footer><!-- dynamically load mathjax for compatibility with self-contained --><script>
  (function () {
    var script = document.createElement("script");
    script.type = "text/javascript";
    var src = "true";
    if (src === "" || src === "true") src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/latest.js?config=TeX-MML-AM_CHTML";
    if (location.protocol !== "file:")
      if (/^https?:/.test(src))
        src = src.replace(/^https?:/, '');
    script.src = src;
    document.getElementsByTagName("head")[0].appendChild(script);
  })();
</script><script type="text/x-mathjax-config">const popovers = document.querySelectorAll('a.footnote-ref[data-toggle="popover"]');
for (let popover of popovers) {
  const div = document.createElement('div');
  div.setAttribute('style', 'position: absolute; top: 0, left:0; width:0, height:0, overflow: hidden; visibility: hidden;');
  div.innerHTML = popover.getAttribute('data-content');

  var has_math = div.querySelector("span.math");
  if (has_math) {
    document.body.appendChild(div);
    MathJax.Hub.Queue(["Typeset", MathJax.Hub, div]);
    MathJax.Hub.Queue(function() {
      popover.setAttribute('data-content', div.innerHTML);
      document.body.removeChild(div);
    })
  }
}
</script>
</body>
</html>
